package com.headStorm.hutooluse;

import cn.hutool.core.map.MapUtil;
import lombok.Data;

import java.util.HashMap;
import java.util.Map;

/**
 * @author zhangqq
 * @create 2021-12-22 11:48
 **/
public class MapUtilDemo {

    public static void main(String[] args) {
        Map<Integer, SortDomain> map = new HashMap<>();
        SortDomain SortDomain1 = new SortDomain(7);
        SortDomain SortDomain2 = new SortDomain(3);
        SortDomain SortDomain3 = new SortDomain(4);
        SortDomain SortDomain4 = new SortDomain(6);
        SortDomain SortDomain5 = new SortDomain(5);
        SortDomain SortDomain6 = new SortDomain(1);
        map.put(1, SortDomain1);
        map.put(2, SortDomain2);
        map.put(3, SortDomain3);
        map.put(4, SortDomain4);
        map.put(5, SortDomain5);
        map.put(6, SortDomain6);

        Map<Integer, SortDomain> integerSortDomainMap = MapUtil.sortByValue(map, false);

        for (Integer integer : integerSortDomainMap.keySet()) {
            System.out.println(integerSortDomainMap.get(integer).getSortNum());
        }


    }
}

